#pragma once
#include "../Global References/VectorContainer.h"
#include "../Global References/Vectors.h"
#include "../Global References/BaseObject.h"
#include "../Global References/EngineResources.h"
#include "Chunk.h"

class DrawlistHandler
{
protected:
	Vector<Block_Info*>		m_vWorldDrawlist;				// world drawlist made of chunks, because not derived from BaseObject
	Vector<BaseObject*>		m_vDrawlists[NUM_DRAWLISTS];	// all other objects should be derived from BaseObject, and can therefore go here

public:
	DrawlistHandler();
	Vector2D	AddObject(BaseObject* pObj, e_drawlists drawlistIndex);
	bool		RemoveObjectByIndex(e_drawlists drawlistIndex, int index);
	bool		RemoveObjectByRef(e_drawlists drawlistIndex, BaseObject* pToRemove);

	/* Functions for adding and removing world chunks from the world drawlist */
	short		AddWorldBlocks(Block_Info** pChunkArr, short size);
	bool		RemoveWorldBlocks(short index, short numToRemove);
	bool		RemoveWorldBlocksByRef(Block_Info* pToRemove,short size);

	
	Vector<BaseObject*> GetObjectDrawlist(int index)	{ return m_vDrawlists[index]; }
	Vector<Block_Info*>		GetWorldDrawlist()				{ 
		return m_vWorldDrawlist;    
	}

};